
package system.base;

import framework.core.*;

/*
	Author    :chengbiao.he
	CreateTime:2008-02-28 10:58:26
*/
public class WarehouseCategoryRelationSearchEvent extends SearchEvent
{

	private String m_id = "" ; // all

	private String m_warehouse_code = "" ; // all

	private String m_warehouse_name = "" ; // all

	private String m_category_code = "" ; // all

	private String m_product_code = "" ; // all

	private double m_display_order = Value.NULL_DOUBLE ; // all

	private String m_status = "" ; // all

	private String m_create_user_id = "" ; // all

	private String m_create_user = "" ; // all

	private String m_create_time = "" ; // all

	private String m_last_update_user_id = "" ; // all

	private String m_last_update_user = "" ; // all

	private String m_last_update_time = "" ; // all
		

public WarehouseCategoryRelationSearchEvent() 
{
	super();
	
	setOrderField(WarehouseCategoryRelation.ID);
		
}



	public String getId()
	{
		return m_id ;
	}
	public void setId(String v)
	{
		m_id = v;
	}

	public String getWarehouseCode()
	{
		return m_warehouse_code ;
	}
	public void setWarehouseCode(String v)
	{
		m_warehouse_code = v;
	}

	public String getWarehouseName()
	{
		return m_warehouse_name ;
	}
	public void setWarehouseName(String v)
	{
		m_warehouse_name = v;
	}

	public String getCategoryCode()
	{
		return m_category_code ;
	}
	public void setCategoryCode(String v)
	{
		m_category_code = v;
	}

	public String getProductCode()
	{
		return m_product_code ;
	}
	public void setProductCode(String v)
	{
		m_product_code = v;
	}

	public double getDisplayOrder()
	{
		return m_display_order ;
	}
	public void setDisplayOrder(double v)
	{
		m_display_order = v;
	}

	public String getStatus()
	{
		return m_status ;
	}
	public void setStatus(String v)
	{
		m_status = v;
	}

	public String getCreateUserId()
	{
		return m_create_user_id ;
	}
	public void setCreateUserId(String v)
	{
		m_create_user_id = v;
	}

	public String getCreateUser()
	{
		return m_create_user ;
	}
	public void setCreateUser(String v)
	{
		m_create_user = v;
	}

	public String getCreateTime()
	{
		return m_create_time ;
	}
	public void setCreateTime(String v)
	{
		m_create_time = v;
	}

	public String getLastUpdateUserId()
	{
		return m_last_update_user_id ;
	}
	public void setLastUpdateUserId(String v)
	{
		m_last_update_user_id = v;
	}

	public String getLastUpdateUser()
	{
		return m_last_update_user ;
	}
	public void setLastUpdateUser(String v)
	{
		m_last_update_user = v;
	}

	public String getLastUpdateTime()
	{
		return m_last_update_time ;
	}
	public void setLastUpdateTime(String v)
	{
		m_last_update_time = v;
	}
		



	public String viewId() throws Exception
	{
		return Value.view(getId());
	}

	public String viewWarehouseCode() throws Exception
	{
		return Value.view(getWarehouseCode());
	}

	public String viewWarehouseName() throws Exception
	{
		return Value.view(getWarehouseName());
	}

	public String viewCategoryCode() throws Exception
	{
		return Value.view(getCategoryCode());
	}

	public String viewProductCode() throws Exception
	{
		return Value.view(getProductCode());
	}

	public String viewDisplayOrder() throws Exception
	{
		return Value.view(getDisplayOrder());
	}

	public String viewStatus() throws Exception
	{
		return Value.view(getStatus());
	}

	public String viewCreateUserId() throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser() throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime() throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewLastUpdateUserId() throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}

	public String viewLastUpdateUser() throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUpdateTime() throws Exception
	{
		return Value.view(getLastUpdateTime());
	}


	public Conditions toConditions() throws Exception
	{
		Conditions c = super.toConditions();

	c.add(getCondition(WarehouseCategoryRelation.ID,getId()));

	c.add(getCondition(WarehouseCategoryRelation.WAREHOUSE_CODE,getWarehouseCode()));

	c.add(getCondition(WarehouseCategoryRelation.WAREHOUSE_NAME,getWarehouseName()));

	c.add(getCondition(WarehouseCategoryRelation.CATEGORY_CODE,getCategoryCode()));

	c.add(getCondition(WarehouseCategoryRelation.PRODUCT_CODE,getProductCode()));

	c.add(getCondition(WarehouseCategoryRelation.DISPLAY_ORDER,getDisplayOrder()));

	//c.add(getCondition(WarehouseCategoryRelation.STATUS,getStatus()));
	if (!getStatus().equals(""))
	{
	    c.add(WarehouseCategoryRelation.PRODUCT_CODE + " in (select CONCENTRICITY_CODE from t_product where status = ?)",Conditions.CUSTOM,getStatus());
	}

	c.add(getCondition(WarehouseCategoryRelation.CREATE_USER_ID,getCreateUserId()));

	c.add(getCondition(WarehouseCategoryRelation.CREATE_USER,getCreateUser()));

	c.add(getCondition(WarehouseCategoryRelation.CREATE_TIME,getCreateTime()));

	c.add(getCondition(WarehouseCategoryRelation.LAST_UPDATE_USER_ID,getLastUpdateUserId()));

	c.add(getCondition(WarehouseCategoryRelation.LAST_UPDATE_USER,getLastUpdateUser()));

	c.add(getCondition(WarehouseCategoryRelation.LAST_UPDATE_TIME,getLastUpdateTime()));
		
	//add by wing start
	if (!getProductName().equalsIgnoreCase("")) {
        c.add(WarehouseCategoryRelation.PRODUCT_CODE + " in (select CONCENTRICITY_CODE from t_product where name = ?)",Conditions.CUSTOM,getProductName());
    }
	if (!getSpec().equalsIgnoreCase("")) {
        c.add(WarehouseCategoryRelation.PRODUCT_CODE + " in (select CONCENTRICITY_CODE from t_product where spec = ?)",Conditions.CUSTOM,getSpec());
    }
	if (!getIsNormal().equalsIgnoreCase("")) {
        c.add(WarehouseCategoryRelation.PRODUCT_CODE + " in (select CONCENTRICITY_CODE from t_product where is_normal = ?)",Conditions.CUSTOM,getIsNormal());
    }
	if (!getIsTradeflatProduct().equalsIgnoreCase("")) {
        c.add(WarehouseCategoryRelation.PRODUCT_CODE + " in (select CONCENTRICITY_CODE from t_product where IS_TRADEFLAT_PRODUCT = ?)",Conditions.CUSTOM,getIsTradeflatProduct());
    }
	if (!getIsBuy().equalsIgnoreCase("")) {
        c.add(WarehouseCategoryRelation.PRODUCT_CODE + " in (select CONCENTRICITY_CODE from t_product where is_buy = ?)",Conditions.CUSTOM,getIsBuy());
    }
	//add by wing end
			
		return c ;
	}
	
//add by chengbiao.he start

//add by chengbiao.he end
	
	//add by wing start
    private String m_product_name = "";
    public String getProductName()
    {
        return this.m_product_name;
    }
    public void setProductName(String productName)
    {
        this.m_product_name = productName;
    }
    
    private String m_spec = "";
    public String getSpec()
    {
        return this.m_spec;
    }
    public void setSpec(String spec)
    {
        this.m_spec = spec;
    }
    
    private String m_is_normal = "";
    public String getIsNormal()
    {
        return this.m_is_normal;
    }
    public void setIsNormal(String isNormal)
    {
        this.m_is_normal = isNormal;
    }
    
    private String m_is_tradeflatProduct = "";
    public String getIsTradeflatProduct()
    {
        return this.m_is_tradeflatProduct;
    }
    public void setIsTradeflatProduct(String isTradeflatProduct)
    {
        this.m_is_tradeflatProduct = isTradeflatProduct;
    }
    
    private String m_is_buy = "";
    public String getIsBuy()
    {
        return this.m_is_buy;
    }
    public void setIsBuy(String isBuy)
    {
        this.m_is_buy = isBuy;
    }
	//add by wing end
}
